//所有路由的配置都放在这里

//1.引入组件
import  {createRouter,createWebHistory} from 'vue-router'
import Button from "../components/Button/Button.vue";
import ButtonDetail from "../components/Button/ButtonDetail.vue";
import Link from "../components/Link/Link.vue";
import Layout from "../components/Layout/Layout.vue";
import Container from "../components/Container/Container.vue";
import Radio from "../components/Radio/Radio.vue";
import CheckBox from "../components/CheckBox/CheckBox.vue";
import Input from "../components/Input/Input.vue";
import Select from "../components/Select/Select.vue";
import Switch from "../components/Switch/Switch.vue";
import DatePicker from "../components/DatePicker/DatePicker.vue";
import Upload from "../components/Upload/Upload.vue";
import Form from "../components/Form/Form.vue";
import Alert from "../components/Alert/Alert.vue";
import Message from "../components/Message/Message.vue";
import Tables from "../components/Table/Tables.vue";



//2.创建路由对象routes
const routes = [
  //  路由重定向:当路由匹配到 `/` 时候,会重定向到 `/button` 上
  //{path: '/', redirect: '/button'},
  {path: '/button',component:Button},
  {path: '/buttondetail',component:ButtonDetail},
  {path: '/link',component:Link},
  {path: '/layout',component:Layout},
  {path: '/container',component:Container},
  {path: '/radio',component:Radio},
  {path: '/checkbox',component:CheckBox},
  {path: '/input',component:Input},
  {path: '/select',component:Select},
  {path: '/switch',component:Switch},
  {path: '/datepicker',component:DatePicker},
  {path: '/upload',component:Upload},
  {path: '/form',component:Form},
  {path: '/alert',component:Alert},
  {path: '/message',component:Message},
  {path: '/table',component:Tables},

]

//配置路由和组件之间的应用关系
const router = createRouter({
  history: createWebHistory(),
  routes: routes,
});

// 导出路由对象,将 router 对象传入到Vue实例
export default router
